<?php
    header('Content-type:text/json');
    require "../../connection.php";
    try{
            $username = $_POST['username'];
            $password = $_POST['password'];
            $nickname = $_POST['nickname'];
            $id = $_POST['id'];
            $arr = array("username"=>$username,"password"=>$password,"nickname"=>$nickname);
            $option = array("id"=>$id);
            $result = $conn->where($option)->update("admin",$arr);
            if($result){
                $msg = "更新成功";
            }else{
                $msg = "更新失败";
            }
            $data = array("status"=>"1","msg"=>$msg);
            echo json_encode($data);
    }catch(Exception $e){
        print_r($e->getMessage());
    }
?>